package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("开始");
        FileOutputStream fos=null;
        try {
            fos =new FileOutputStream("./A./B.fos.dat");
        }catch (IOException e){
            System.out.println("出现Io异常并解决");
        }finally {
            try {
                fos.close();
            } catch (Exception e) {
                System.out.println("关闭流时出现异常并解决了");
            }
        }
        System.out.println("结束");
    }
}
